package com.spring.dao.impl;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;

import com.spring.dao.UserDao;

public class UserDaoImpl05 implements UserDao{
	
	private DataSource dataSource ;
	private JdbcTemplate jdbcTemplate ;
	
	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	
	public void init() {
		jdbcTemplate = new JdbcTemplate(dataSource) ;
	}


	@Override
	public void saveUser() {
		String sql = "insert into tb_user(id,username,birthday,sex,address) values(null,'武器',null,'2','北京市')" ;
		jdbcTemplate.execute(sql) ;
	}

}
